package com.xia.qianke.dao;

import com.xia.qianke.entity.client.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

/**
 * @ClassName ClientDAO
 * @Description TODO
 * @Author XJY
 * @Date 2022/7/11 12:03
 * @Version 1.0
 **/
@Repository
public class ClientDAO {

    @Autowired
    JdbcTemplate jdbcTemplate;

    public void addMd5(String phoneMd5){
        jdbcTemplate.update ("insert t_qkmd5(`md5`) values(?)",phoneMd5);
    }

    public Integer checkUser(String phoneMd5){
        return jdbcTemplate.queryForObject ("select count(*) from t_qkmd5 where md5 = ?",
                Integer.class, phoneMd5);
    }
}
